<?php
session_start();
require("../include/init.php");
$act = $_REQUEST['act'];
if($act == 'submit') {
	$username = $_POST['username'];
	$userpass = md5($_POST['userpass']);
	$row = $GLOBALS['db']->fetch_array($GLOBALS['db']->query("select * from kyz_admin where admin_name='$username' and admin_pass='$userpass' limit 1"));
	if(!empty($row)) {
		$_SESSION['admin_id'] = $row['admin_id'];
		$_SESSION['admin_name'] = $row['admin_name'];
		header("Location: index.php");
	} else {
		echo "<script>alert('用户名/密码， 错误');window.location.href='login.php'</script>";
		
	}
} else {
	$smarty->display('admin/login.html');
}




?>